Optimal. Leaf size=183 \[ -\frac {(C-B (2+m)) (a+a \cos (e+f x))^m \sin (e+f x)}{f (1+m) (2+m)}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {2^{\frac {1}{2}+m} \left (B m (2+m)+C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) (1+\cos (e+f x))^{-\frac {1}{2}-m} (a+a \cos (e+f x))^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\cos (e+f x))\right ) \sin (e+f x)}{f (1+m) (2+m)} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.18, antiderivative size = 183, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {3102, 2830,
2731, 2730} \begin {gather*} \frac {2^{m+\frac {1}{2}} \left (A \left (m^2+3 m+2\right )+B m (m+2)+C \left (m^2+m+1\right )\right ) \sin (e+f x) (\cos (e+f x)+1)^{-m-\frac {1}{2}} (a \cos (e+f x)+a)^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\cos (e+f x))\right )}{f (m+1) (m+2)}-\frac {(C-B (m+2)) \sin (e+f x) (a \cos (e+f x)+a)^m}{f (m+1) (m+2)}+\frac {C \sin (e+f x) (a \cos (e+f x)+a)^{m+1}}{a f (m+2)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2730
Rule 2731
Rule 2830
Rule 3102
Rubi steps
\begin {align*} \int (a+a \cos (e+f x))^m \left (A+B \cos (e+f x)+C \cos ^2(e+f x)\right ) \, dx &=\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\int (a+a \cos (e+f x))^m (a (C (1+m)+A (2+m))-a (C-B (2+m)) \cos (e+f x)) \, dx}{a (2+m)}\\ &=-\frac {(C-B (2+m)) (a+a \cos (e+f x))^m \sin (e+f x)}{f (1+m) (2+m)}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\left (B m (2+m)+C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) \int (a+a \cos (e+f x))^m \, dx}{(1+m) (2+m)}\\ &=-\frac {(C-B (2+m)) (a+a \cos (e+f x))^m \sin (e+f x)}{f (1+m) (2+m)}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {\left (\left (B m (2+m)+C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) (1+\cos (e+f x))^{-m} (a+a \cos (e+f x))^m\right ) \int (1+\cos (e+f x))^m \, dx}{(1+m) (2+m)}\\ &=-\frac {(C-B (2+m)) (a+a \cos (e+f x))^m \sin (e+f x)}{f (1+m) (2+m)}+\frac {C (a+a \cos (e+f x))^{1+m} \sin (e+f x)}{a f (2+m)}+\frac {2^{\frac {1}{2}+m} \left (B m (2+m)+C \left (1+m+m^2\right )+A \left (2+3 m+m^2\right )\right ) (1+\cos (e+f x))^{-\frac {1}{2}-m} (a+a \cos (e+f x))^m \, _2F_1\left (\frac {1}{2},\frac {1}{2}-m;\frac {3}{2};\frac {1}{2} (1-\cos (e+f x))\right ) \sin (e+f x)}{f (1+m) (2+m)}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 2.80, size = 376, normalized size = 2.05 \begin {gather*} \frac {i 4^{-1-m} e^{i f m x} \left (1+e^{i (e+f x)}\right )^{-2 m} \left (e^{-\frac {1}{2} i (e+f x)} \left (1+e^{i (e+f x)}\right )\right )^{2 m} \cos ^{-2 m}\left (\frac {1}{2} (e+f x)\right ) (a (1+\cos (e+f x)))^m \left (\frac {C e^{-i (2 e+f (2+m) x)} \, _2F_1\left (-2-m,-2 m;-1-m;-e^{i (e+f x)}\right )}{2+m}+\frac {2 B e^{-i (e+f (1+m) x)} \, _2F_1\left (-1-m,-2 m;-m;-e^{i (e+f x)}\right )}{1+m}+\frac {2 B e^{i (e-f (-1+m) x)} \, _2F_1\left (1-m,-2 m;2-m;-e^{i (e+f x)}\right )}{-1+m}+\frac {C e^{2 i e-i f (-2+m) x} \, _2F_1\left (2-m,-2 m;3-m;-e^{i (e+f x)}\right )}{-2+m}+\frac {4 A e^{-i f m x} \, _2F_1\left (-2 m,-m;1-m;-e^{i (e+f x)}\right )}{m}+\frac {2 C e^{-i f m x} \, _2F_1\left (-2 m,-m;1-m;-e^{i (e+f x)}\right )}{m}\right )}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.27, size = 0, normalized size = 0.00 \[\int \left (a +a \cos \left (f x +e \right )\right )^{m} \left (A +B \cos \left (f x +e \right )+C \left (\cos ^{2}\left (f x +e \right )\right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \left (\cos {\left (e + f x \right )} + 1\right )\right )^{m} \left (A + B \cos {\left (e + f x \right )} + C \cos ^{2}{\left (e + f x \right )}\right )\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (a+a\,\cos \left (e+f\,x\right )\right )}^m\,\left (C\,{\cos \left (e+f\,x\right )}^2+B\,\cos \left (e+f\,x\right )+A\right ) \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________